/*
 * $Id: ExportColor.java,v 1.3 2003/05/23 19:21:48 milca Exp $
 *
 * Copyright (c) Milan Jedlicka
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 * 
 */

package net.sf.vofce.export;

import java.awt.Color;

/**
 * Extension of Color class for another type of color form exporting to
 * templates.
 * While <code>java.awt.Color</code> works with channel ranges 0&ndash;255,
 * majority of the export formats use the range 0&ndash;1. This class adds
 * methods that return the RGB values in this range.
 *
 * @author Milan Jedlicka
 */
public class ExportColor extends Color {

	public ExportColor(Color c) {
		super(c.getRed(), c.getGreen(), c.getBlue());
	}
	
	/** Returns the red component in the range 0-1 in the default sRGB space. */
	public double get01Red() {
		return getRed() / 255d;
	}

	/** Returns the green component in the range 0-1 in the default sRGB space. */
	public double get01Green() {
		return getGreen() / 255d;
	}

	/** Returns the blue component in the range 0-1 in the default sRGB space. */
	public double get01Blue() {
		return getBlue() / 255d;
	}
}
